import axios from "axios"
const userLogin = {
  userLogin(data) {
    return axios.post('/api/userLogin',data)
  },
  getCode(){
    return axios.get('/api/getcode')
  },
  //调用user相关接口
  loadUserList(params){
    return axios.get('/api/user',{params})
  },
  userOne(params){
    return axios.get('/api/userOne',{params})
  },
  addUser(data){
    return axios.post('/api/userAdd',data)
  },
  deleteUser(data){
    return axios.post('/api/deleteUser',data)
  },
  updateUser(data){
    return axios.post('/api/updateUser',data)
  },
  searchUser(params){
    return axios.get('/api/searchUser',{params})
  },
  //调用role相关接口
  loadRoleList(params){
    return axios.get('/api/role',{params})
  },
  addRole(data){
    return axios.post('/api/roleAdd',data)
  },
  deleteRole(data){
    return axios.post('/api/deleteRole',data)
  },
  updateRole(data){
    return axios.post('/api/updateRole',data)
  },
  searchRole(params){
    return axios.get('/api/searchRole',{params})
  },
  //调用power相关接口
  loadPowerList(params){
    return axios.get('/api/power',{params})
  },
  addPower(data){
    return axios.post('/api/powerAdd',data)
  },
  deletePower(data){
    return axios.post('/api/deletePower',data)
  },
  updatePower(data){
    return axios.post('/api/updatePower',data)
  },
  searchPower(params){
    return axios.get('/api/searchPower',{params})
  },
  //调用user和role和power之间联系的接口
  allRole(params){
    return axios.get('/api/allRole',{params})
  },
  user_role(params){
    return axios.get('/api/user_role',{params})
  },
  user_role_(params){
    return axios.post('/api/user_role',params)
  },
  allPower(params){
    return axios.get('/api/allPower',{params})
  },
  role_power(params){
    return axios.get('/api/role_power',{params})
  },
  role_power_(params){
    return axios.post('/api/role_power',params)
  },
  //加载用户所有权限
  loadUserAllPer(params){
    return axios.get('/api/getUserPer',{params})
  },
  //上传图片
  upload(data){
    return axios.post('/api/upload',data)
  },
  //和商品goods相关接口
  loadGoodsList(params){
    return axios.get('/api/goods',{params})
  },
  addGoods(data){
    return axios.post('/api/goodsAdd',data)
  },
  deleteGoods(data){
    return axios.post('/api/deleteGoods',data)
  },
  updateGoods(data){
    return axios.post('/api/updateGoods',data)
  },
  searchGoods(params){
    return axios.get('/api/searchGoods',{params})
  },
  //和订单相关接口
  loadOrderList(params){
    return axios.get('/api/order',{params})
  },
  deleteOrder(data){
    return axios.post('/api/deleteOrder',data)
  },
  updateOrder(data){
    return axios.post('/api/updateOrder',data)
  },
  searchOrder(params){
    return axios.get('/api/searchOrder',{params})
  },
}
export default userLogin;